package com.multimedia.room.view;

import android.content.Context;
import android.util.AttributeSet;
import android.util.Log;

import com.multimedia.room.R;


/**
 * Image icon with animation for list item in playing screen
 * @author brlygolo
 */
public class MusicIndicatorView extends MusicAnimationDrawableView {

    public MusicIndicatorView(Context context) {
        super(context);
    }

    public MusicIndicatorView(Context context, AttributeSet attrs) {
        super(context, attrs);
    }

    public MusicIndicatorView(Context context, AttributeSet attrs, int defStyle) {
        super(context, attrs, defStyle);
    }

    @Override
    protected int getLoopAnimationResource() {
        return R.drawable.music_small_loop_animation;
    }

    @Override
    protected int getEndAnimationResource() {
        return R.drawable.music_small_end_animation;
    }

    @Override
    protected int getStoppedResource() {
        return R.drawable.png_small_paused;
    }

    public void played() {
        if (DEBUG) Log.d(TAG, "played, " + this);
        stopAnimation();
        setImageResource(R.drawable.icn_played_60x60);
    }

    public void byDefault() {
        if (DEBUG) Log.d(TAG, "byDefault, " + this);
        stopAnimation();
        setImageDrawable(null);
    }

    public void addToPlaylist() {
        if (DEBUG) Log.d(TAG, "addToPlaylist, " + this);
        stopAnimation();
        setImageResource(R.drawable.icn_add_to_queue_60x60);
    }

    public void queued() {
        if (DEBUG) Log.d(TAG, "queued, " + this);
        stopAnimation();
        setImageResource(R.drawable.icn_queued_60x60);
    }
}
